#ifndef GROUPCHANGEDEVENT_H_
#define GROUPCHANGEDEVENT_H_

#include <wx/event.h>
#include "../Group.h"

namespace Impp
{

enum GroupChangedEventType{
	GROUP_CHANGED_ADDED,
	GROUP_CHANGED_NAME,
};

class GroupChangedEvent : public wxNotifyEvent
{
private:
	Group* group;
	GroupChangedEventType changeType;

public:
	GroupChangedEvent(Group* group, GroupChangedEventType changeType, wxEventType eventType = wxEVT_NULL, int id = 0);
	virtual ~GroupChangedEvent();

	virtual wxEvent* Clone()const;
	Group* getGroup();
	GroupChangedEventType getChangeType();
};

typedef void(wxEvtHandler::*GroupChangedEventFunction)(GroupChangedEvent&);

BEGIN_DECLARE_EVENT_TYPES()
  DECLARE_EVENT_TYPE(EVT_GROUP_CHANGED, -1)
END_DECLARE_EVENT_TYPES()

#define EVT_GROUP_CHANGED_MACRO(id, fn) DECLARE_EVENT_TABLE_ENTRY(               \
	EVT_GROUP_CHANGED, id, -1, (wxObjectEventFunction)               \
        (wxEventFunction)(GroupChangedEventFunction) & fn,                             \
        (wxObject*) NULL),

#define GroupChangedEventHandler(func)                                                 \
        (wxObjectEventFunction)                                                \
        (wxEventFunction)wxStaticCastEvent(GroupChangedEventFunction, &func)

}

#endif /*GROUPCHANGEDEVENT_H_*/
